package com.cmy.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
//代表这个类被Spring托管
//被改注解注解的类中的所有方法,如果返回值是String,且有与之同名的页面存在,则会被视图解析器解析
@RequestMapping("/t2")
public class ControllerDemo02 {
    @RequestMapping("/t2")
    public String test01(Model model){
        model.addAttribute("msg","hello guys2");
        return "test";//WEB/INF/jsp/hello.jsp
    }

    @RequestMapping("/t3")
    public String test02(Model model){
        model.addAttribute("msg","hello guys3");
        return "test";//WEB/INF/jsp/hello.jsp
    }
}

    